
<%@ page import="stravel.User"%>
<!DOCTYPE html>
<html>
<head>
<meta name="layout" content="admin">
<g:set var="entityName"
	value="${message(code: 'user.label', default: 'User')}" />
<title><g:message code="default.show.label" args="[entityName]" /></title>
</head>
<body>

	<div class="header">

		<h1 class="page-title">
			<g:message code="default.show.label" args="[entityName]" />
		</h1>
		<ul class="breadcrumb">
			<li><a href="${createLink(uri: '/')}"><g:message
						code="default.home.label" /></a></li>
			<li><g:link action="index">
					<g:message code="default.list.label" args="[entityName]" />
				</g:link></li>
			<li class="active"><g:message code="default.show.label"
					args="[entityName]" /></li>
		</ul>

	</div>


	<div class="main-content">
		<g:if test="${flash.message}">
			<bootstrap:alert class="alert-info">
				${flash.message}
			</bootstrap:alert>
		</g:if>


		<dl class="dl-horizontal">

			<dt>
				<g:message code="user.username.label" default="Username" />
			</dt>
			<dd>

				<g:fieldValue bean="${userInstance}" field="username" />


			</dd>


		</dl>

		<table class="table table-striped">
			<thead>
				<tr>

					Role


					<th></th>
				</tr>
			</thead>
			<tbody>
			<g:each in="${userInstance?.getAuthorities()}" var="roleInstance">
			<tr>
			<td>
			${roleInstance?.authority }
			</td>
			<td>
			<g:link controller="user" action="removeRole" params="[id:userInstance?.id,roleId:roleInstance.id]">
			Delete
			</g:link>
			</td>
			</tr>
			</g:each>
			</tbody>
		</table>
		<g:form class="form-horizontal" action="addRole" >
		<g:hiddenField name="id" value="${userInstance?.id }"/>
		<div class="form-group">
        <label class="col-sm-2 control-label" for="username">
          Role
          <span class="required-indicator">*</span>
        </label>
        <div class="col-sm-10">
              <g:select id="roleId" name="roleId" from="${stravel.Role.list()}" optionKey="id" required="" value="" class="many-to-one"/>
<button type="submit" class="btn btn-primary">
            <i class="icon-ok icon-white"></i>
            Add Role
          </button>
        </div>
  </div>
		</g:form>

		<div class="form-actions">			<g:link class="btn btn-primary" action="list">
				<g:message code="default.button.list.label" default="List" />
			</g:link>
		</div>
	</div>




</body>
</html>
